window.phoenix&&(window.phoenix.buildInfo||(window.phoenix.buildInfo=[]),-1===window.phoenix.buildInfo.findIndex((e=>"Phoenix-privacy"===e.MFE))&&window.phoenix.buildInfo.push({MFE:"Phoenix-privacy",VERSION:"rc-phoenix-privacy-1.1.5808.1340761529-3db9388f-2-gf847a06",LASTCOMMITDATETIME:"2024-06-21T14:21:31+00:00"})) /*! * * ============= BUILD INFO ============= * MFE: Phoenix-privacy * chunkName: service-clientlibs/global-privacy/global-privacy * VERSION: rc-phoenix-privacy-1.1.5808.1340761529-3db9388f-2-gf847a06 * BRANCH: HEAD * COMMITHASH: f847a06ef4fa6067a82b63deb345c4061c53c832 * LASTCOMMITDATETIME: 2024-06-21T14:21:31+00:00 * ============= If you're reading this, why not come work with us? https://www.t-mobile.com/careers ============= */,function(){"use strict";const e="dnt",o="DoNotSell",t="Sell",n="1",i="0";function a(a,s,l,d){const r=function(i,a,s){const l={};if("MbyT"===a&&window.sessionStorage.getItem("accessToken")){const e=function(){const e={Authorization:"",userID:"",idType:"SubscriberID"},o=window.sessionStorage.getItem("accessToken")||"",t=o.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),n=decodeURIComponent(atob(t).split("").map((e=>"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2))).join(""));return e.userID=JSON.parse(n).identifier,e.Authorization=o,e}();l.Authorization=e.Authorization,l.idType="SubscriberID",l.userID=e.userID}else if("Magenta"===a){const e=window.Cookies.get("id_token");e&&(l.Authorization=e,l.idType="TMOID",l.userID=window.Cookies.get("defaultTMOID")||"")}return l.Brand=a,l.LocaldoNotSellSetting=function(){return window.Cookies.get(e)===n?o:t}(),l.Site=i,l.Origin_URL=s,l}(s,l,d),c=document.createElement("form");c.target="dnspage",c.method="post",c.action=a;Object.keys(r).forEach((e=>{const o=document.createElement("input");o.type="text",o.name=e,o.value=r[e],c.appendChild(o)})),document.body.appendChild(c),function(t){if(window.location.hostname.indexOf(".t-mobile.com")>-1)return;let a=window.location.origin;t.startsWith("/")||(a=new URL(t).origin);window.addEventListener("message",(t=>{if(t.origin===a&&t.data&&"string"==typeof t.data){const a=t.data===o?n:i;window.Cookies.remove(e),window.Cookies.set(e,a,{expires:3650,secure:!0,domain:"."+window.location.hostname.split(".").slice(-2).join(".")}),window.phoenix.bus?.publish("DNT_COOKIE","SET_COOKIE",{payload:{doNotTrack:a===n}})}}))}(a),window.open(a,"dnspage","width=750,height=750,resizeable,scrollbars"),c.submit(),document.body.removeChild(c)}document.addEventListener("opendnspage",(e=>{let o="https://www.t-mobile.com/dns",t="Sell_Web",n="Magenta",i=window.location.origin+window.location.pathname;e.detail&&(e.detail.dnsPageUrl&&(o=e.detail.dnsPageUrl),e.detail.Site&&(t=e.detail.Site),e.detail.Brand&&(n=e.detail.Brand),e.detail.Origin_URL&&(i=e.detail.Origin_URL)),a(o,t,n,i)}));const s={appName:"phoenix-privacy",className:"dnt-cookie"};window.phoenix.bus?.subscribe("DNT_COOKIE","REFRESH",(function(e){const o=window.Cookies.get("id_token"),t=window.Cookies.get("gdns"),n=window.sessionStorage.getItem("globalDoNotSellSetting");!function(e){let o;!navigator.globalPrivacyControl&&"1"!==navigator.doNotTrack||"1"===window.Cookies.get("dnt")?(o=!1,window.gpcDNTSet=!1):(window.Cookies.set("dnt","1",{expires:365,secure:!0,domain:"."+window.location.hostname.split(".").slice(-2).join(".")}),o=!0,window.gpcDNTSet=!0);window.phoenix.bus?.publish("DNT_COOKIE","SET_COOKIE",{payload:{doNotTrack:o}},e)}(e),navigator.globalPrivacyControl&&(o&&t&&t.length>0?async function(e,o){if(o.indexOf("s!0")>-1||o.indexOf("s!1~d!0")>-1){const o="/self-service-flex/v1/dns/setsettings",t=window.Cookies.get("defaultTMOID");try{200===(await fetch(o,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({brand:"Magenta",dnsSetting:"DoNotSell",dnsSettingSource:window.location.origin+window.location.pathname,dnsType:"Global",globalPrivacyControlSignal:"Yes",id:t,idType:"TMOID",token:e})})).status&&window.Cookies.set("gdns","s!1~d!1",{domain:"."+window.location.hostname.split(".").slice(-2).join(".")})}catch(e){window.phoenix.log.error(e.message,s,{exception:e})}}}(o,t):n&&n.length>0&&async function(e){const o=window.sessionStorage.getItem("globalDoNotSellSettingDate");if("Sell"===e||"DoNotSell"===e&&!o){const e="/self-service-sigma-account/v1/consumer/get-do-not-sell-setting",o=window.sessionStorage.getItem("accessToken"),t=window.sessionStorage.getItem("mdn"),n=window.localStorage.getItem("rmToken"),i=window.Cookies.get("l3Token")||null,a={"Content-Type":"application/json",Authorization:"Bearer "+o,"Rm-Token":n,mdn:t};i&&(a.cookie="l3Token="+i+";");try{const o=await fetch(e,{method:"POST",credentials:"include",headers:a,body:JSON.stringify({brand:"MbyT",doNotSellRulesFlag:"Yes",doNotSellType:"Global",eventName:"getDoNotSellSettingService",globalPrivacyControlSignal:"Yes",idType:"SubscriberID",localDoNotSellValue:"DoNotSell"})});if(200===o.status){const e=await o.json(),t=e?.globalDoNotSellSetting,n=e?.globalDoNotSellSettingDate;t&&(window.sessionStorage.setItem("globalDoNotSellSetting",t),n&&window.sessionStorage.setItem("globalDoNotSellSettingDate",n))}}catch(e){window.phoenix.log.error(e.message,s,{exception:e})}}}(n))})),window.phoenix.bus.publish("DNT_COOKIE","REFRESH")}();